package com.sk.coin.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sk.coin.sys.entity.WebConfig;
import com.sk.coin.sys.mapper.WebConfigMapper;
import com.sk.coin.sys.service.IWebConfigService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 网站配置信息 服务实现类
 * </p>
 *
 * @author Administrator
 * @since 2022-02-21
 */
@Service
public class WebConfigServiceImpl extends ServiceImpl<WebConfigMapper, WebConfig> implements IWebConfigService {

    @Override
    public Page<WebConfig> findByPage(Page<WebConfig> page, String name, String type) {
        return page(page,new LambdaQueryWrapper<WebConfig>()
                .eq(StringUtils.isNotEmpty(type),WebConfig::getType,type)
                .like(StringUtils.isNotEmpty(name),WebConfig::getName,name));
    }
}
